10. Completing PID Controller

Completing PID Controller Class

Before you can begin to explore and tune the first controller, you must first complete the PID controller class in the quad_rotor package using the code that you developed during the first module.

You have been provided with a template for creating a PID controller class in python.

You can find this template under:

~catkin_ws/src/RoboND-Controls-Lab/quad_controller/src/quad_controller/pid_controller.py

The template file looks something like this:

class PIDController:
    def __init__(self, kp = 0.0, ki = 0.0, kd = 0.0, max_windup = 10):
        #TODO
        pass
    def reset(self):
        #TODO
        pass

    def setTarget(self, target):
        #TODO
        pass

    def setKP(self, kp):
        #TODO
        pass

    def setKI(self, ki):
        #TODO
        pass

    def setKD(self, kd):
        #TODO
        pass

    def setMaxWindup(self, max_windup):
        #TODO
        pass

    def update(self, measured_value, timestamp):
        #TODO
        pass

Populate all the functions marked TODO using the PID controller you wrote in the previous lesson.

Next, you will launch the simulator and explore the Hover Controller.